home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / fileli1r / frmcode.frm (.txt) < prev    next >
Visual Basic Form  |  1999-09-02  |  4KB  |  158 lines

  1. VERSION 4.00
  2. Begin VB.Form frmCode 
  3.    Caption         =   "Codepad  Untitled"
  4.    ClientHeight    =   4680
  5.    ClientLeft      =   1440
  6.    ClientTop       =   1530
  7.    ClientWidth     =   6975
  8.    Height          =   5115
  9.    Icon            =   "frmCode.frx":0000
  10.    Left            =   1380
  11.    LinkTopic       =   "frmCode"
  12.    ScaleHeight     =   4680
  13.    ScaleWidth      =   6975
  14.    Top             =   1155
  15.    Width           =   7095
  16.    Begin VB.CommandButton cmdSaveAs 
  17.       Caption         =   "Save As"
  18.       Height          =   315
  19.       Left            =   1605
  20.       TabIndex        =   4
  21.       Top             =   0
  22.       Width           =   810
  23.    End
  24.    Begin VB.CommandButton cmdSave 
  25.       Caption         =   "Save"
  26.       Height          =   315
  27.       Left            =   810
  28.       TabIndex        =   3
  29.       Top             =   0
  30.       Width           =   780
  31.    End
  32.    Begin VB.CommandButton cmdClear 
  33.       Caption         =   "Clear"
  34.       Height          =   300
  35.       Left            =   6120
  36.       TabIndex        =   2
  37.       Top             =   0
  38.       Width           =   840
  39.    End
  40.    Begin VB.CommandButton cmdBrowse 
  41.       Caption         =   "Browse"
  42.       Height          =   315
  43.       Left            =   -15
  44.       TabIndex        =   1
  45.       Top             =   0
  46.       Width           =   810
  47.    End
  48.    Begin VB.TextBox Text1 
  49.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  50.          Name            =   "MS Sans Serif"
  51.          Size            =   9.75
  52.          Charset         =   0
  53.          Weight          =   400
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   4380
  59.       Left            =   0
  60.       MultiLine       =   -1  'True
  61.       ScrollBars      =   3  'Both
  62.       TabIndex        =   0
  63.       Top             =   285
  64.       Width           =   6975
  65.    End
  66.    Begin VB.Timer Timer1 
  67.       Enabled         =   0   'False
  68.       Interval        =   4000
  69.       Left            =   2880
  70.       Top             =   2100
  71.    End
  72.    Begin MSComDlg.CommonDialog dlgCode 
  73.       Left            =   2295
  74.       Top             =   1605
  75.       _ExtentX        =   847
  76.       _ExtentY        =   847
  77.       _Version        =   327681
  78.    End
  79. Attribute VB_Name = "frmCode"
  80. Attribute VB_Creatable = False
  81. Attribute VB_Exposed = False
  82. Option Explicit
  83. Dim Chnge As Boolean
  84. Private Sub cmdSave_Click()
  85. Dim fnum As Integer
  86. fnum = FreeFile
  87. On Error Resume Next
  88. Open dlgCode.filename For Output As fnum
  89. Print #fnum, Text1.Text
  90. Close fnum
  91. frmCode.Caption = "Codepad  " & dlgCode.filename
  92. Chnge = False
  93. End Sub
  94. Private Sub cmdClear_Click()
  95. Text1.Text = ""
  96. dlgCode.filename = ""
  97. frmCode.Caption = "Codepad  Untitled"
  98. Chnge = False
  99. End Sub
  100. Private Sub cmdBrowse_Click()
  101. Dim txt As String
  102. Dim fname As String
  103. dlgCode.CancelError = True
  104. dlgCode.DialogTitle = "Open File"
  105. On Error Resume Next
  106. dlgCode.ShowOpen
  107. If Err.Number = cdlCancel Then
  108. Exit Sub
  109. End If
  110. fname = dlgCode.filename
  111. frmCode.Caption = "Codepad  " & fname
  112. On Error GoTo Out
  113. Open fname For Input As #1
  114. txt = Input(LOF(1), #1)
  115. Text1.Text = txt
  116. Close #1
  117. Chnge = False
  118. End Sub
  119. Private Sub cmdSaveAs_Click()
  120. dlgCode.CancelError = True
  121. dlgCode.DialogTitle = "Save As"
  122. On Error Resume Next
  123. dlgCode.ShowOpen
  124. If Err.Number = cdlCancel Then
  125. Exit Sub
  126. End If
  127. cmdSave_Click
  128. End Sub
  129. Private Sub Form_Load()
  130. Timer1.Interval = 4000
  131. With dlgCode
  132. .Filter = "Text Files:(*.txt)|*.txt|"
  133. .Filter = .Filter & "Forms:(*.frm)|*.frm|"
  134. .Filter = .Filter & "Modules:(*.bas)|*.bas|"
  135. .Filter = .Filter & "Projects:(*.vbp)|*.vbp|"
  136. .Filter = .Filter & "Classes:(*.cls)|*.cls|"
  137. End With
  138. Chnge = False
  139. End Sub
  140. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  141. If Chnge = True Then
  142. Cancel = True
  143. Timer1.Enabled = True
  144. Me.Hide
  145. frmClose.Show
  146. End If
  147. End Sub
  148. Private Sub Form_Resize()
  149. Text1.Height = frmCode.ScaleHeight - 265
  150. Text1.Width = frmCode.Width - 100
  151. cmdClear.Left = frmCode.Width - 980
  152. End Sub
  153. Private Sub Text1_KeyPress(KeyAscii As Integer)
  154. Chnge = True
  155. End Sub
  156. Private Sub Timer1_Timer()
  157. End Sub
  158.